from rest_framework import serializers
from django.contrib.auth.models import Permission,ContentType


class PermissionSerializer(serializers.ModelSerializer):
    """权限管理"""
    class Meta:
        model = Permission
        fields = "__all__"


class ContentTypeSerializer(serializers.ModelSerializer):
    """获取权限类序列化器"""
    name = serializers.StringRelatedField()
    class Meta:
        model = ContentType
        fields = "__all__"